
Page({

  /**
   * 页面的初始数据
   */
  data: {
    longitude: 113.765594, //默认定位经度
    latitude: 23.024644, //默认定位纬度
    markers: [{
        id: 0,
        iconPath: "/images/barrel.png",
        latitude: 23.026788,
        longitude: 113.77196,
        width: 20, //图片显示宽度
        height: 20 //图片显示高度
      },
      {
        id: 1,
        iconPath: "/images/barrel.png",
        latitude:23.023346,
        longitude:113.740174,
        width: 20,
        height: 20
      },
      {
        id: 2,
        iconPath: "/images/barrel.png",
        latitude:23.020334,
        longitude:113.77383,
        width: 20,
        height: 20
      },
      {
        id: 3,
        iconPath: "/images/barrel.png",
        latitude:23.027877,
        longitude: 113.783109,
        width: 20,
        height: 20
      },
      {
        id: 4,
        iconPath: "/images/barrel.png",
        latitude:23.019904,
        longitude:113.77944,
        width: 20,
        height: 20
      },
      {
        id: 5,
        iconPath: "/images/barrel.png",
        latitude:23.025488,
        longitude:113.76454,
        width: 20,
        height: 20
      },

      {
        id: 6,
        iconPath: "/images/barrel.png",
        latitude: 23.024161,
        longitude: 113.765712,
        width: 20,
        height: 20
      }
    ]

  },
  tapTabbar1() {
    wx.reLaunch({
      url: '/pages/index/index',
    })
  },
  tapTabbar2() {
    wx.reLaunch({
      url: '/pages/shop/index/index',
    })
  },
  tapTabbar4() {
    wx.reLaunch({
      url: '/pages/my/my',
    })
  },
  toSitedetails(){
wx.navigateTo({
  url: '/pages/site/details/details',
})
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    var that = this;
    wx.getLocation({
      type: "...",
      success: function (res) {
        var latitude = res.latitude;
        var longitude = res.longitude;
        //console.log(res.latitude);
        that.setData({
          latitude: res.latitude,
          longitude: res.longitude,
          markers: [{
            latitude: res.latitude,
            longitude: res.longitude,

          }]
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})